1. Field of the Invention
The present invention relates to a file management system and program for managing files in a computer. More particularly, the present invention relates to a file management system and program which efficiently manage the locations of files in a directory structure.
2. Description of the Related Art
Computers incorporate file systems into their core mechanisms to manage program and data files stored in a hard disk drive (HDD) and other storage devices. File system is a logical structure consisting of substantive records of files and additional information for managing their locations and usage.
Most file systems employ a hierarchical architecture to ease the management of a large number of files. In such a hierarchical file system, directories and user files are modeled as nodes and leaves of a tree. Individual files are identified by their locations in the hierarchical structure, in combination with their file names. The location of a file is obtained by tracing nodes and links of the tree structure from its root directory. The discovered route from the root directory to the file of interest is called “path name” (or simply “path”). File systems locate a particular file by using its path name and file name as key information.
Each directory accommodates files and child directories (also called “subdirectories”), and the file system has to manage such hierarchical relationships among such objects. Conventional file systems achieve this by maintaining management data of each individual directory. Every file can therefore be reached by following the directory structure from top to bottom, if its path name and file name are given.
Conventional file systems, however, do not have facilities for upward tracing of the directory tree, from a low-level file to its parent directories. For this reason, it is not easy to find the path name of a specific file when that file has been identified with some unusual method other than the normal directory search. If this is the case, the conventional file management system has to perform an exhaustive search for possible paths, starting from the root directory. Considering the probability of discovery, the search should cover, on average, one half of the file system before the requested path name is successfully found. This is unsuitable, however, for heavily-loaded large-scale file systems because they are supposed to process a lot of transactions at high speeds.
The lack of upward search facilities hampers conventional file systems from providing advanced functions. For example, think of a function that sets a certain attribute (e.g., “never update last-access date”) to all files in a particular directory and its subdirectories. One possible method to implement this function is to add the attribute to each individual file and directory for later reference. When an access to a file occurs, the file system checks its corresponding attribute record to determine whether to update the last-access date of that file. The trouble occurs when a file or directory is relocated to other places. While the moved directory and its subordinate file and directories are required to inherit attributes from the destination directory, it is not practical to implement this function as a realtime task, because it would pose a large amount of processing load. Actually, conventional systems implement only a part of the above function with a limited consistency.
Consider here that a certain file has been subjected to some file manipulation. To determine what to do with that file, the file management system needs attribute information that resides somewhere up in the directory structure. If the file system was designed to be traceable from that file in the upward direction, it would be possible to find an upper-level directory whose attributes are supposed to be applied to its subordinate directories and files. In this file system configuration, there is no need to distribute attributes to all directories and files, but they can be concentrated in a certain upper directory.
As seen from the above, conventional file systems have limited themselves in a smaller range of applications, due to the lack of upward tracing capability. With conventional systems, it is difficult to apply a particular file system operation to a plurality of files and directories by setting an attribute to their common upper-level directory.